package com.cloudsigns.factorymanager2.produce.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.produce.activity.ProduceAttendanceListActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceDailyReportListActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceFeedbackListActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceFeedbackListFragmentActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceWorkpartHandoverListActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceProductWarehousingListActivity;
import com.cloudsigns.factorymanager2.produce.activity.ProduceScheduleFormActivity;

public class ProduceManagerFragment extends Fragment implements View.OnClickListener {
    private RelativeLayout rl_progress_form, rl_produce_feedback, rl_process_handover, rl_daily_list, rl_product_storage, rl_production_attendance, rl_produce_statue, rl_abnormal_analysis, rl_inspection_handover;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_produce_manager, null);
        rl_progress_form = view.findViewById(R.id.rl_progress_form);
        rl_produce_feedback = view.findViewById(R.id.rl_produce_feedback);
        rl_process_handover = view.findViewById(R.id.rl_process_handover);
        rl_daily_list = view.findViewById(R.id.rl_daily_list);
        rl_product_storage = view.findViewById(R.id.rl_product_storage);
        rl_production_attendance = view.findViewById(R.id.rl_production_attendance);
        rl_produce_statue = view.findViewById(R.id.rl_produce_statue);
        rl_abnormal_analysis = view.findViewById(R.id.rl_abnormal_analysis);
        rl_inspection_handover = view.findViewById(R.id.rl_inspection_handover);

        rl_progress_form.setOnClickListener(this);
        rl_produce_feedback.setOnClickListener(this);
        rl_process_handover.setOnClickListener(this);
        rl_daily_list.setOnClickListener(this);
        rl_product_storage.setOnClickListener(this);
        rl_production_attendance.setOnClickListener(this);
        rl_produce_statue.setOnClickListener(this);
        rl_abnormal_analysis.setOnClickListener(this);
        rl_inspection_handover.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View view) {
        Intent mIntent;
        switch (view.getId()) {
            // 进度表
            case R.id.rl_progress_form:
               // mIntent=new Intent(getActivity(), ProduceProgressFormActivity.class);
                mIntent=new Intent(getActivity(),ProduceScheduleFormActivity.class);
//                mIntent=new Intent(getActivity(),ProduceStatusScheduleFormActivity.class);
                startActivity(mIntent);
                break;
            // 生产反馈
            case R.id.rl_produce_feedback:
//                mIntent=new Intent(getActivity(), ProduceFeedbackListActivity.class);
                mIntent=new Intent(getActivity(), ProduceFeedbackListFragmentActivity.class);
                startActivity(mIntent);
                break;
            // 工序交接
            case R.id.rl_process_handover:
                mIntent=new Intent(getActivity(), ProduceWorkpartHandoverListActivity.class);
                startActivity(mIntent);
                break;
            // 日报表
            case R.id.rl_daily_list:
                mIntent=new Intent(getActivity(), ProduceDailyReportListActivity.class);
                startActivity(mIntent);
                break;
            // 产品入库
            case R.id.rl_product_storage:
                mIntent=new Intent(getActivity(), ProduceProductWarehousingListActivity.class);
                startActivity(mIntent);
                break;
            // 生产考勤
            case R.id.rl_production_attendance:
                mIntent=new Intent(getActivity(), ProduceAttendanceListActivity.class);
                startActivity(mIntent);
                break;
            // 生产状态
            case R.id.rl_produce_statue:
                break;
            // 异常分析
            case R.id.rl_abnormal_analysis:
                break;
            // 质检/交接
            case R.id.rl_inspection_handover:
                break;
        }
    }





}
